{% extends "bills/base.html" %}
{% block js %}
{{ form.media }}
{% endblock %}
{% block body_main %}
<table border="0">
 <tr>
  <td>
   <form enctype="multipart/form-data" action="" method="POST">
	{% csrf_token %}
	<table border="1">
		<caption> В Архив </caption>
		{{ form.as_table }}
 <tr>
  <td> Оригинал: </td>
  <td> <ol style="margin: 0">
   {% for img in bill.fileseq.fileseqitem_set.all %}
    <li>
     <a href="{% url 'core.views.file_get' img.pk %}" data-lightbox="roadtrip" title="{{ img.file.name }}">{{ img.file.name }}</a>
     <a href="{% url 'core.views.file_get' img.pk %}"> <img src="{{ STATIC_URL }}img/16/png.png" title="Download"/> </a>
    </li>
   {% endfor %}
  </ol> </td>
 </tr>
	</table>
	<button type="submit"> Записать </button>
	<a href="{% url 'bills.views.bill_view' bill.pk %}"> <button type="button"> Отказаться </button> </a>
   </form>
  </td>
<td valign="top">
<table border="1">
<caption> История: </caption>
<thead>
 <th> Ok </th>
 <th> Когда </th>
 <th> Кто </th>
 <th> Камменты </th>
</thead>
<tbody>
  {% for i in bill.events.all %}
  <tr>
   <td valign="top"> <img {% if i.resume %} src="{{ STATIC_URL }}img/32/dialog-ok.png" title="OK" {% else %} src="{{ STATIC_URL }}img/32/dialog-cancel.png" title="Canceled" {% endif %} width="16px" height="16px"/> </td>
   <td valign="top"> {{i.ctime|date:"y.m.d H:i:d" }} </td>
   <td valign="top"> {{ i.approve.get_fio }} </td>
   <td valign="top"> <pre style="margin: 0"> {{ i.comment }} </pre> </td>
  </tr>
  {% endfor %}
</tbody>
</table>
</td>
</tr>
</table>

{% endblock %}
